import send_msg from './_service';

/*
 * 调用nodejs服务
 * @param action_id 系统参数actionid
 * @param session_id 系统参数sessionid
 * @param spaceid 项目spaceid
 * @param service_name 服务名称
 * @param condition 服务参数，参数key不能包含：spaceid, modelid
 */
export default async function nodejs<T>(_action_id: string, _session_id: string, spaceid: string, service_name: string, condition = {}) {
	const params = {
		...condition,
		modelid: 'custom::js_' + service_name,
		spaceid
	};
	return await send_msg<T>('dataservice.nodejs', params, false, false);
}
